package com.start_eternity.oasissafewalk.mapper;
import com.start_eternity.oasissafewalk.pojo.PageBean;
import com.start_eternity.oasissafewalk.pojo.ParentStudent;
import com.start_eternity.oasissafewalk.pojo.Student;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * author:ZhangT
 * Date:2024 / 03 / 19 / 8:40
 * Description:
 */

public interface StudentMapper {

    /*根据ID删除*/
    int delete(List<Integer> sId);

    /*查询*/
    @Select("select * from parent_student where s_id=#{sId}")
    @Results({
            @Result(property = "student",column = "s_id",
            javaType = Student.class,
                    one = @One(select = "com.start_eternity.oasissafewalk.mapper.ParentMapper.queryByPId"))
    })
    List<ParentStudent> selectById(@Param("sId")Integer sId);

    /*新增成员*/
    @Insert("insert into student(s_name,s_age,s_gender,school_name,create_time)"+
            "values (#{sName},#{sAge},#{sGender},#{schoolName},#{createTime})")
    int insert(Student student);

    /*修改*/
    int update(Student student);

    //分页查询
    public List<Student> queryPage(int current,int size);

}
